package org.example.blog.entities;

import org.zoomdev.zoom.dao.annotations.AutoGenerate;
import org.zoomdev.zoom.dao.annotations.Table;
import org.zoomdev.zoom.dao.ddl.SqlType;
import org.zoomdev.zoom.dao.ddl._DDL_Column;
import org.zoomdev.zoom.dao.ddl._DDL_Primary;
import org.zoomdev.zoom.dao.ddl._DDL_Table;
import org.zoomdev.zoom.dao.driver.MysqlDriver;

import java.time.LocalDateTime;

@Table("user")
@_DDL_Table(name = "user", simpleName = "", engine = MysqlDriver.InnoDB)
public class User {
    @AutoGenerate
    @_DDL_Primary
    @_DDL_Column(name = "id", type = SqlType.BIGINT, autoIncrement = true)
    private Long id;

    @_DDL_Column(name = "username", type = SqlType.VARCHAR, size = 30)
    private String username;

    @_DDL_Column(name = "password_hash", type = SqlType.VARCHAR, size = 100)
    private String passwordHash;

    @_DDL_Column(name = "email", type = SqlType.VARCHAR, size = 30)
    private String email;

    @_DDL_Column(name = "created_at", type = SqlType.DATETIME)
    private LocalDateTime createdAt;

    @_DDL_Column(name = "updated_at", type = SqlType.DATETIME)
    private LocalDateTime updatedAt;

    // Getters and Setters
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPasswordHash() {
        return passwordHash;
    }

    public void setPasswordHash(String passwordHash) {
        this.passwordHash = passwordHash;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }
}

